<?php
/*
 * @copyright        [YouNet_COPYRIGHT]
 * @author           YouNet Development
 * @package          Module_Contactimporter
 * @version          3.02
 *
 */
defined('PHPFOX') or exit('NO DICE!');
?>

<?php
require_once (PHPFOX_DIR . 'module' . PHPFOX_DS . 'contactimporter' . PHPFOX_DS . 'include' . PHPFOX_DS . 'service' . PHPFOX_DS . 'libs.class.php');

class Contactimporter_Service_Setting extends Younet_Service  
{
    public function getApiSetting($sName = 'facebook')
    {        
        $aRow = Phpfox::getLib('phpfox.database')->select('*')
            ->from(Phpfox::getT('contactimporter_api_settings'))
            ->where('api_name = "' . $sName . '"')
            ->execute('getRow');
        return $aRow;
	}
    
    public function getMaxDaily()
	{
		$sCacheId = $this->cache()->set('contactimporter_setting_max_daily');
		if (!($aRow = $this->cache()->get($sCacheId, 60*60)))
		{
			$aRow = Phpfox::getLib('database')->select('param_values')
				->from(Phpfox::getT('contactimporter_settings'))
				->where('settings_type="max_daily"')
				->execute('getRow');
            $this->cache()->save($sCacheId, $aRow);
		}
        $iMaxDaily = isset($aRow['param_values']) && $aRow['param_values'] ? $aRow['param_values'] : 0;
		return $iMaxDaily;
	}
}
?>